import React, {useRef} from 'react';

function App(props) {
    const userRef = useRef();
    const handler = function(){
        // console.log(document.querySelector("input").value)
        console.log(userRef.current === document.querySelector("input"))
    }
    return (
        <div>
            <input ref={userRef} type="text"/>
            <button onClick={handler}>收集</button>
        </div>
    );
}

export default App;